﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UMLTouch.Core.Entities;

namespace UMLTouch.DomainRecognition.ShapeRecognition
{
    public class SquarePattern : IShapePattern
    {
        #region IShapePattern Members

        public ShapePatternMatchingResultEnum Match(Shape shape)
        {
            Console.WriteLine(shape.NbAngleGreaterThan90);
            if (shape.NbSegments < 4)
            {                
                return ShapePatternMatchingResultEnum.MightMatch;
            }
            else if(shape.NbSegments == 4)
            {                
                return ShapePatternMatchingResultEnum.Match;
            }
            else
            {                
                return ShapePatternMatchingResultEnum.DontMatch;
            }
            
        }

        #endregion

        public override string ToString()
        {
            return "Square";
        }
    }
}
